#ifndef __BASE_DEFINE_H__
#define __BASE_DEFINE_H__

#include <gflags/gflags.h>
#include <glog/logging.h>
#include <opencv2/highgui.hpp>
#include <Eigen/Eigen>
#include <Eigen/Dense>

#include <ros/ros.h>
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2/utils.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h> 
#include <nav_msgs/OccupancyGrid.h>
#include <nav_msgs/Odometry.h>
#include <nav_msgs/Path.h>
#include <sensor_msgs/LaserScan.h>
#include <sensor_msgs/Imu.h>
#include <sensor_msgs/PointCloud.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/point_cloud_conversion.h> // sensor_msgs::convertPointCloud2ToPointCloud
#include <geometry_msgs/TransformStamped.h>
#include <geometry_msgs/PoseStamped.h>
#include <geometry_msgs/Twist.h>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/conversions.h>
#include <pcl_conversions/pcl_conversions.h> // For pcl::toROSMsg
#include <pcl/common/transforms.h> // For pcl::transformPointCloud
#include <pcl/common/common.h>  // For pcl::concatenatePointCloud


using namespace std;
using namespace Eigen;

using Vec2i = cv::Point2i;
using Vec2f = cv::Point2f;
using Velocity2D = Eigen::Vector3f;         //vx vy vyaw
using Pose2D = Eigen::Vector3f;             //x,y,yaw
using PoseAffine3f = Eigen::Affine3f;   
using OccupancyGridPtr = nav_msgs::OccupancyGrid::Ptr;

// 定义基础数据类型
namespace sensor_data{
    using Scan2D = sensor_msgs::LaserScan;
    using Scan2DPtr = Scan2D::Ptr;
    using PointCloudXYZ = pcl::PointCloud<pcl::PointXYZ>;
    using PointCloudXYZPtr = pcl::PointCloud<pcl::PointXYZ>::Ptr;
    using PointCloud2 = sensor_msgs::PointCloud2;
    using PointCloud2Ptr = sensor_msgs::PointCloud2::Ptr;
    using Imu = sensor_msgs::Imu;
    using ImuPtr = sensor_msgs::Imu::Ptr;
    using Odometry = nav_msgs::Odometry;
    using OdometryPtr = nav_msgs::Odometry::Ptr;
}

// 传感器数据配置
struct SeneorConfig{
    string topic_name = "";             // 话题名称
    string frame_id = "";               // 坐标系
    Eigen::Affine3f transform_matrix;   // 坐标系转换 base_link -> frame_id
    bool enable = true;                 // 是否启用
    bool has_transform = false;         // 是否需要坐标系转换
    int index = 0;                      // 传感器编号
};

#endif